import request from "@/utils/request"

//分页查询
export function pageList(data){
    return request({
        url: "/homeWork/pageList",
        method: "post",
        data
    });
}

//新增or修改
export function addOrUpdateWork(data){
    return request({
        url: "/homeWork/addOrUpdateWork",
        method: "post",
        data
    });
}

//删除
export function deleteById(data){
    return request({
        url: "/homeWork/deleteById",
        method: "post",
        data
    });
}

//详情
export function workDetails(query){
    return request({
        url: "/homeWork/details/"+query,
        method: "get"
    });
}

//查询作业评论
export function findCommentsDetails(data){
    return request({
        url: "homeWork/findCommentsDetails",
        method: "post",
        data
    });
}

//查询评论回复
export function findreplyDetails(data){
    return request({
        url: "homeWork/findreplyDetails",
        method: "post",
        data
    });
}

//新增回复
export function addReply(data){
    return request({
        url: "homeWork/addReply",
        method: "post",
        data
    });
}

//查询老师和科目
export function getTeacherSubj(classId){
    return request({
        url: `homeWork/getTeacherSubj/${classId}`,
        method: "get"
    });
}

export function getTeacherClass(){
    return request({
        url: `homeWork/getTeacherClass`,
        method: "get"
    });
}

export function getTeacherSubjAll(classId){
    return request({
        url: `homeWork/getTeacherSubjAll/${classId}`,
        method: "get"
    });
}
